<!DOCTYPE html>
<!--教师 学生 信息通告页面-->
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>信息通告浏览</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="static/css/layui.css" media="all">
  <link rel="stylesheet" href="static/layuiadmin/style/admin.css" media="all">
<!--  <script src="static/js/jquery-2.1.3.min.js"></script>-->
</head>
<body>

<div class="layui-card layadmin-header">
  <div class="layui-breadcrumb" lay-filter="breadcrumb">
    <a lay-href="">主页</a>
    <a><cite>信息管理</cite></a>
    <a><cite>信息通告浏览</cite></a>
  </div>
</div>

<div class="layui-fluid">
  <div class="layui-row layui-col-space15">
    <div class="layui-col-md12">
      <div class="layui-card">
        <div class="layui-card-header card-title">信息通告浏览</div>
        <div class="layui-card-body">
          <form class="layui-form" lay-filter="component-form-group" id="search_submits" onsubmit="return false">
            <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="layadmin-useradmin-formlist">
              <div class="layui-inline">
                <label class="layui-form-label">内容关键字：</label>
                <div class="layui-input-inline">
                  <input type="text" class="layui-input" id="info" name="info" placeholder="请输入内容关键字"  width="80px">
                </div>
              </div>
              <div class="layui-inline">
                <button class="layui-btn" lay-submit="search_submits" lay-filter="reloadlst_submit">查询</button>
              </div>
              <div class="layui-inline">
                <a class="layui-btn btn-add btn-default" id="export">导出数据</a>
              </div>
            </div>
<!--            <div class="layui-btn-group test-table-operate-btn" style="margin-bottom: 10px;">-->
<!--            -->
<!--            </div>-->
          </form>
          <table class="layui-hide" id="test-table-cellEdit" lay-filter="test-table-cellEdit"></table>
        </div>
      </div>
    </div>
  </div>
</div>

<script src="static/layui.js"></script>
<script th:inline="none">
  layui.config({
    base: 'static/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'table','form'], function(){
    var $ = layui.$;
    var table = layui.table;
    var form = layui.form;
    var exportData;
    var loading = layer.load();
    var ins1 = table.render({ /*当前表格进行“重载”等操作*/
      elem: '#test-table-cellEdit'
      ,method:'post'
      , url: '/selectxxtgll'
      , cols: [[
        {field: 'fbrid', title: '发布人账号', width: 160, sort: true}
        , {field: 'info', title: '通告内容', width: 500,sort:true}
        , {field: 'fbtime', title: '发布时间', width: 200,sort:true}
      ]]
      , done: function (res, curr, count) {
        layer.close(loading);
        exportData = res.data;
      }
    })

    form.on('submit(reloadlst_submit)', function (data) {
      var searchdata = data.field;
      var info = searchdata.info;
      ins1.reload({
        where:{
          info:info
        }
      });
    })

    $("#export").click(function(){
      table.exportFile(ins1.config.id,exportData, 'xls');
    })

  });

</script>
</body>
</html>